package com.lsy.seckill.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class RabbitMQSeckillConfig {
    private final static String QUEUE="queue";
    private final static String EXCHANGE="exchange";
    @Bean
    public Queue getQueue(){
        return new Queue(QUEUE);
    }
    @Bean
    public TopicExchange getExchange(){
        return new TopicExchange(EXCHANGE);
    }
    @Bean
    public Binding bindingBuilder(){
        return BindingBuilder.bind(getQueue())
                .to(getExchange()).with("sekill.#");
    }
}
